Ext.define('PJ.view.trainingmanagement.AuditClassList', {
    extend: 'AM.default.DefaultList',
    alias: ['widget.trainingmanagementAuditClassList'],
    requires: ['AM.default.DefaultSearchForm',
               'AM.default.DateTime', 
               'AM.default.DefaultDateField',
               'AM.default.DefaultDoubleDateField',
               'AM.default.jsonp.DefaultLoadJsonp',//jsonp加载数据
		       'AM.default.DefaultActiveStateCombo',
		       'PJ.view.registrationmanagement.ApplicationAuditUserListLevel1',//学员确认
		       'PJ.view.registrationmanagement.ApplicationNoUserList'//未参与培训班人员
		      // 'PJ.view.quotamanagement.PlanPlacesList'//计划名额
               ],
               initComponent: function(){
                  	var me= this;
                  	this.columns = [/*{
                  		header: '培训班编号',
                  		dataIndex: 't.classNum',
                  		width: 120,
                  		renderer: function(value, meta, record){
                  			meta.style = "white-space:normal;cursor: pointer;color:blue;";
                  			meta.tdAttr = "data-qtip='" + value + "' classId=" + record.get("classId");
                  			return value;
                  		},
                  		listeners: {
                  			click: function(g, clm){
                  				var classId = clm.getAttribute("classId");
                  				win = Ext.create('PJ.view.trainingmanagement.Look', {
                  					title: "查看培训班",
                  					flag:4,
                  					grid: me,
                  					isDisable:false,
                  					isReadOnly:true,
                  					classId:classId,
                  					isHideExpectTime: false
                  				}).show();
                  				var actionName = "load";
                  				if(gj_onlineLearning_constant.loadType == "jsonp"){
                  					actionName = "loadJsonp";
                  				}
                  				win.down("form").getForm().doAction(actionName,{
                  					url:me.store.preUpdateUrl,
                  					params:{
                  						classId: classId
                  					},
//                  					success:function(f,action){
//                  						var data = action.response.responseText;
//                  	        			var json = gj_onlineLearning_constant.loadType=="ajax" ? Ext.decode(data, true) : action.response;
//                  	        			var form = win.down('form');	 
//                  	        			var baseForm = form.getForm();
//                  	        			baseForm.findField("classNum").setValue(json.data.classNum);
//                  	        			baseForm.findField("classNum_").setValue(json.data.classNum);
//                  					}
                  				});
                  			}
                  		}
                  	},*/{
                          header: '培训班名称',
                          dataIndex: 't.className',
                          flex: 1,
                          minWidth: 120,
                  		renderer: function(value, metaData, record){
                  			/*metaData.tdAttr = 'data-qtip="' + value + '"';
                  			return value;*/
                  			metaData.style = "white-space:normal;cursor: pointer;color:blue;";
                  			metaData.tdAttr = "data-qtip='" + value + "' classId=" + record.get("classId");
                  			return value;
                  		},
                  		listeners: {
                  			click: function(g, clm){
                  				var classId = clm.getAttribute("classId");
                  				win = Ext.create('PJ.view.trainingmanagement.LookPxarchives', {
                  					title: "查看培训班",
                  					flag:4,
                  					grid: me,
                  					isDisable:false,
                  					isReadOnly:true,
                  					classId:classId,
                  					isHideExpectTime: false
                  				}).show();
                  				var actionName = "load";
                  				if(gj_onlineLearning_constant.loadType == "jsonp"){
                  					actionName = "loadJsonp";
                  				}
                  				win.down("form").getForm().doAction(actionName,{
                  					url:me.store.preUpdateUrl,
                  					params:{
                  						classId: classId
                  					},
                  				});
                  			}
                  		}
                      },{
                          header: '主办单位',
                          dataIndex: 't.sponsorName',
                          width: 180,
                  		  renderer: function(value, metaData, record){
                  			metaData.tdAttr = 'data-qtip="' + value + '"';
                  			return value;
                  		  }
                      },/*{
                          header: '建班单位',
                          dataIndex: 't.createDepname',
                          width: 130,
                  		  renderer: function(value, metaData, record){
                  			metaData.tdAttr = 'data-qtip="' + value + '"';
                  			return value;
                  		  }
                      },*/{
                          header: '开班时间',
                          dataIndex: 't.beginDate',
                          width: 120 
                      },{
                          header: '结业时间',
                          dataIndex: 't.endDate',
                          width: 120 
                      },{
                          header: '班级学时',   
                          dataIndex: 't.trainingHour',
//                          sortable: false,
                          width: 80,
                          renderer: function(value, metaData, record){
                          	return value /*+ '/' + record.get('classUserNum')*/;
                          }
                      },{
                          header: '学时汇总',   
                          dataIndex: 'trainingClassSum',
                          width: 80,
                          sortable: false,
                          renderer: function(value, metaData, record){
                          	return value /*+ '/' + record.get('classUserNum')*/;
                          }
                      },{
                          header: '平均学时',   
                          dataIndex: 'trainingClassAvg',
                          width: 80,
                          sortable: false,
                          renderer: function(value, metaData, record){
                          	return value /*+ '/' + record.get('classUserNum')*/;
                          }
                      },{
                          header: '培训班类型',
                          dataIndex: 't.classTypeStr',
                          renderer: function(v, metaData, record){
                              return v;
                          },
                          width: 120
                      },/*{
                          header: '培训班人数',     '已报人数/计划人数',
                          dataIndex: 'reportedNumber',
                          width: 90,
                          sortable: false,
                          renderer: function(value, metaData, record){
                          	return value + '/' + record.get('classUserNum');
                          }
                      },*/{
                    	  header: '已考核/待考核',
                          dataIndex: 'lockNum',
                          width: 100,
                          sortable: false,
	                      renderer: function(value, meta, record){
	                      	meta.style = "white-space:normal;cursor: pointer;color:blue;";
	                      	meta.tdAttr = "data-qtip='" + value + "' classId=" + record.get("classId") + " lockDateState=" + record.get("lockDateState") + " lockState=" + record.get("t.lockState");
	              			return value;
	                      },
	                  	  listeners: {
	                			click: function(g, clm){
	                				var classId = clm.getAttribute("classId");
	                				var lockState = clm.getAttribute("lockState");
	                				var lockDateState = clm.getAttribute("lockDateState");
	                				 if(lockDateState==2){
	                           			Ext.Msg.show({
	                           				  title: '提示',
	                           			  	  msg  : '本班级确认时间已过，请与管理员联系（63524157-8001）',
	                           			  	  icon :Ext.Msg.WARNING,
	                           			  	  buttons:Ext.Msg.OK
	                           			  });
	                           			  return;
	                           		  }
	                           		Ext.create('AM.default.DefaultWindowView', {
	                                       title: "培训学时确认",
	                                       height:510,
	                                       width: 1055,
	                                       grid: me,
	                           			   clickSource:2,
	                                       classId: classId,
	                                       lockState: lockState,
	                                       items: [{
	                                           xtype: 'applicationAuditUserListLevel1'
	                                       }],
	                                       listeners: {
	                                       	close: function(){
	                                       		me.getStore().load();
	                                       	}
	                                       }
	                                   });
	                			}
	                		}
                      },{
                    	  header: '未参与培训班人数',
                          dataIndex: 'noClassUserNum',
                          width: 100,
                          sortable: false,
	                      renderer: function(value, meta, record){
	                      	meta.style = "white-space:normal;cursor: pointer;color:blue;";
	                      	meta.tdAttr = "data-qtip='" + value + "' classId=" + record.get("classId") + " lockDateState=" + record.get("lockDateState") + " lockState=" + record.get("t.lockState");
	              			return value;
	                      },
	                  	  listeners: {
	                			click: function(g, clm){
	                				var classId = clm.getAttribute("classId");
//	                				var lockState = clm.getAttribute("lockState");
//	                				var lockDateState = clm.getAttribute("lockDateState");
//	                				 if(lockDateState==2){
//	                           			Ext.Msg.show({
//	                           				  title: '提示',
//	                           			  	  msg  : '本班级确认时间已过，请与管理员联系（63524157-8001）',
//	                           			  	  icon :Ext.Msg.WARNING,
//	                           			  	  buttons:Ext.Msg.OK
//	                           			  });
//	                           			  return;
//	                           		  }
	                           		Ext.create('AM.default.DefaultWindowView', {
	                                       title: "未参与培训班学员",
	                                       height:500,
	                                       width: 555,
	                                       grid: me,
	                           			   clickSource:2,
	                                       classId: classId,
//	                                       lockState: lockState,
	                                       items: [{
	                                           xtype: 'ApplicationNoUserList'
	                                       }],
	                                       listeners: {
	                                       	close: function(){
	                                       		me.getStore().load();
	                                       	}
	                                       }
	                                   });
	                			}
	                		}
                      },{
                          header: '锁定状态',
                          dataIndex: 't.lockState',
                          renderer: function(v, metaData, record){
                              if (v == 0) {
                                  return '<span style="color:green;">' + '未锁定' + '</span>';
                              }
                              else if(v == 1) {
                                  return '<span style="color:red;">' + '已锁定' + '</span>';
                              }
                          },
                          width: 90
                      }/*,{
                          header: '班级状态',
                          dataIndex: 't.openState',
                          renderer: function(v, metaData, record){
                          	if(record.get("t.publishState") == 2){
                          		return '未开班';
                          	}else{
                          		if (v == 3) {
                                      return '<span style="color:red;">' + '已结班' + '</span>';
                                  }
                                  else if(v == 1) {
                                      return '<span style="color:green;">' + '已开班' + '</span>';
                                  }
                                  else if(v == 2) {
                                      return '未开班';
                                  }
                          	}
                          },
                          width: 70
                      },{
                          header: '报名状态',
                          dataIndex: 't.signUpState',
                          renderer: function(v, metaData, record){
                          	if(record.get("t.publishState") == 2){
                          		return '<span style="color:red;">' + '未开始' + '</span>';
                          	}else if(record.get("t.publishState") == 1 && record.get("t.openState") == 1){
                          		return '<span style="color:red;">' + '报名结束' + '</span>';
                          	}else{
                          		if (v == 2) {
                                      return '<span style="color:red;">' + '未开始' + '</span>';
                                  }
                                  else if(v == 1) {
                                      return '<span style="color:green;">' + '正在报名' + '</span>';
                                  }
                                  else if(v == 3) {
                                      return '<span style="color:red;">' + '报名结束' + '</span>';
                                  }
                          	}
                          },
                          width: 70
                      }*//*, {
                      	header: '二维码',
                          dataIndex: 'registrationExplanation',
                          width: 65,
                          align: 'center',
                          renderer: function(value, metaData, record){
                          	metaData.tdAttr = 'classNum="' + record.get("q.classNum") + '" classId="' + record.get("classId") + '"';
                          	return '<span class="QRcodeIco" style="cursor: pointer;"></span> ';
                          },
                          listeners: {
              	            click: function(g, clm){
              	            	var classId = clm.getAttribute("classId");
              	            	var src = me.store.qrCodeUrl + "?classId=" + classId;
                          		Ext.create('AM.default.DefaultWindowView', {
                          			title: '二维码',
                          			width: 450,
                          			height: 550,
                          			grid: me,
                          			html: "<iframe src=\"" + src + "\" frameborder='0' style=\"width:100%;height:100%\"></iframe>",
                          			*
                          			items: [{
                          				html: '<div style="text-align: center;padding-top:10px;"><span color="#A9A9A9">' + subjectTitle + '</span></div><img src="./skin/red/images/QRcodegj.png" alt="二维码" style="width:255px;height:255px;padding:8px 20px 20px 20px;">'
                          			}],
                          			*
                          			buttons: [{
                          	            text: '关闭',
                          	            scope: this,
                          	            handler: function(button, event){
                          	                var win = button.up('window');
                          	                win.close();
                          	            }
                          	        }]
                          		}).show();
              	            }
                          }
                      }*//*, {
                          header: '下载参训通知',
                          menuDisabled: true,
                          sortable: false,
                          resizable: false,
                          hideable: false,
                          xtype: 'actioncolumn',
                          width: 80,
                          items: [{
                          	//tooltip: '下载参训通知',
                          	getClass: function(v, meta, rec){
                          		var selectedLetters = rec.get('selectedLetters');
                          		if(!Ext.isEmpty(selectedLetters)){
                          			meta.style = "cursor: pointer;";
                              		return 'templateIco';
                          		}
                      		},
                              handler: function(grid, rowIndex, colIndex, item, eve, record){
                                  var store = grid.getStore();
                                  var atag = Ext.get("exportResume");
                                  atag.set({
                                      "href": store.downloadUrl+'?attachmentID='+record.get('selectedLetters')
                                  });
                                  atag.dom.click();
                              }
                          }]
                      }*/];
                  	
                      this.store = Ext.create('PJ.'+ prototype +'.trainingmanagement.AuditClassList',{
                      	isLoad: true
                      });
                      this.callParent(arguments);
                      this.loadType = gj_onlineLearning_constant.loadType;//加载方式
                  },
                  //发送
              	onAddMsgClick:function(){
                      var me = this;
                      var record=me.getSelectionModel().getSelection();
                  	var classId = record[0].get("classId");
                  	var className = record[0].get("t.className");
              		if(this.getSelectionModel().getCount() > 1){
                          Ext.Msg.show({
                              title: '提示',
                              msg: '操作时只可选中一条记录！',
                              icon: Ext.Msg.WARNING,
                              buttons: Ext.Msg.OK
                          });
                      	return;
                      }
              		win = Ext.create('PJ.view.messagemanagement.Edit', {
                      	title: "新增发送消息",
                      	width: 520,
                      	height:330,
                      	typeCode:1,
                      	classId:classId,
                      	flagStr:"class",
                      	grid: me
                      }).show();
              		win.down('panel').getForm().findField("defaultValue").setValue(className);
              		win.down('panel').getForm().findField("newsTypeCode").setValue("xxlx_pxb");
                  },
              	//新增
              	onAddClick:function(){
                      var me = this;
                      var classValue="";
                      Ext.Ajax.request({
                          url: 'module/trainingclass/preAddTraining2.json',
                          method: 'GET',
                          //async :  true,
                          success: function (response, options) {
                        	  
                              classValue=JSON.parse(response.responseText);
                              var selectScopeStr =classValue.sponsorName;
                              var selectScopeId=classValue.sponsorID;
//                              var classNum=classValue.classNum;
//                              var selectScopeStr = $(document.getElementById("selectScope")).find("option:selected").text();
//                              var selectScopeId=$(document.getElementById("selectScope")).find("option:selected")[0].value;
                              Ext.create('PJ.view.trainingmanagement.Add',{
                              	title: "新增培训班",
                                flag:1,
                              	grid: me,
                              	isDisable:true,
                              	isReadOnly:false,
                              	selectScopeStr:selectScopeStr,
                              	selectScopeId:selectScopeId,
//                              	classNum:classNum
                              });
                          },
                          failure: function (response, options) {
                              Ext.MessageBox.alert('失败', '请求超时或网络故障,错误编号：' + response.status);
                          }
                      });
                  },
              	//修改
              	onUpdateClick:function(){
              		var me = this;
              		var record=me.getSelectionModel().getSelection();
                  	var classId = record[0].get("classId");
              		if(this.getSelectionModel().getCount() > 1){
                          Ext.Msg.show({
                              title: '提示',
                              msg: '操作时只可选中一条记录！',
                              icon: Ext.Msg.WARNING,
                              buttons: Ext.Msg.OK
                          });
                      	return;
                      }
              		if(record[0].get("t.lockState")==1){
              			Ext.Msg.show({
                              title: '提示',
                              msg: '已审核的信息不允许再进行修改操作!',
                              icon: Ext.Msg.WARNING,
                              buttons: Ext.Msg.OK
                          });
                      	return;
              		}
                      win = Ext.create('PJ.view.trainingmanagement.Edit', {
                      	title: "更新培训班",
                          flag:2,
                      	grid: me,
                      	isDisable:true,
                      	classId:classId,
                      	isReadOnly:false
                      }).show();
              		var actionName = "load";
              		if(gj_onlineLearning_constant.loadType == "jsonp"){
              			actionName = "loadJsonp";
              		}
              		win.down("form").getForm().doAction(actionName,{
                  		url:me.store.preUpdateUrl,
                  		params:{
                  			classId: classId
                  		},
                  		success:function(f,action){
                  			var data = action.response.responseText;
                  			var json = gj_onlineLearning_constant.loadType=="ajax" ? Ext.decode(data, true) : action.response;
                  			var form = win.down('form');	 
                  			var baseForm = form.getForm();
                  			baseForm.findField("classNum").setValue(json.data.classNum);
                  			baseForm.findField("classNum_").setValue(json.data.classNum);
                  		}
                  	});
              	},
                  //配置课程
                  onConfigurationClick: function(button){
                  	var me = this;
                      var records = me.getSelectionModel().getSelection();
                      if (button.up("grid").getSelectionModel().getCount() > 1) {
                          Ext.Msg.show({
                              title: '警告',
                              msg: '操作时只可选中一条记录！',
                              icon: Ext.Msg.WARNING,
                              buttons: Ext.Msg.OK
                          });
                          return;
                      }else {
                      	win = Ext.create('PJ.view.trainingmanagement.ConfigurationCourseEdit',{
                          	title: "配置课程",
                          	grid: me,
                          	classId: records[0].get("classId")
                          }).show();
                  		var actionName = "load";//默认使用非JSONP的加载方法名“load”
                          if(gj_onlineLearning_constant.loadType=="jsonp") {
                          	actionName= "loadJsonp";
                          }
                          win.down('form').getForm().doAction(actionName,{
                          	url: me.store.preUpdateUrl,
                              params: {
                              	classId: records[0].get("classId")//培训班ID
                              },
                              success:function(form,action){
                              	var data = action.response.responseText;
                      			var json = gj_onlineLearning_constant.loadType=="ajax" ? Ext.decode(data, true) : action.response;
                      			var dateStar = json.data.beginDateStr;//举办时间（开始）
                      			var dateEnd = json.data.endDateStr;//举办时间（截止）
                      			var form = win.down('form');	 
                      			var baseForm = form.getForm();
                      			baseForm.findField("learnTime").setValue(dateStar + ' 至 ' + dateEnd);
                              }
                          });
                      }
                  },
                //报名
                  onSignupClick: function(){
                  	var me = this;
                      var records = me.getSelectionModel().getSelection();
                      if(records.length > 1){
                          Ext.Msg.show({
                              title: '提示',
                              msg: '只允许操作一条数据！',
                              icon: Ext.Msg.WARNING,
                              buttons: Ext.Msg.OK
                          });
                  		return;
                  	}
                      if(records[0].get("t.lockState") == 1){
                      	Ext.Msg.show({
                              title: '提示',
                              msg: '无法对已审核的班级进行报名！',
                              icon: Ext.Msg.WARNING,
                              buttons: Ext.Msg.OK
                          });
                          return;
                      }
                     var win = Ext.create('PJ.view.unitregistrationmanagement.SignUpFrame', {
              			grid: me,
              			title: "报名",
              			width: 1200,
              			height: 650,
              			classId: records[0].get("classId"),
              			openState: records[0].get("t.openState"),
              			publishState: records[0].get("t.publishState"),
              			signUpState:1,
              			auditingState:3,
              			clickSource:2
              		}).show();
              		var actionName = "load";
                      if(gj_onlineLearning_constant.loadType=="jsonp") {
                      	actionName= "loadJsonp";
                      }
                      win.down('form').getForm().doAction(actionName,{
                      	url: me.store.configurationUrl,
                          params: {
                          	classId: records[0].get("classId")//培训班ID
                          },
                          success:function(form,action){
                          	var data = action.response.responseText;
                  			var json = gj_onlineLearning_constant.loadType=="ajax" ? Ext.decode(data, true) : action.response;
                  			var dateStar = json.data.beginDateStr;//举办时间（开始）
                  			var dateEnd = json.data.endDateStr;//举办时间（截止）
                  			var form = win.down('form');	 
                  			var baseForm = form.getForm();
                  			baseForm.findField("className").setValue(json.data.className);//班级名称
                  			baseForm.findField("learnTime").setValue(dateStar + ' 至 ' + dateEnd);
                          }
                      });
                  },
              //查看报名通过人员
                onViewSignupStatus:function(){
                	var me = this;
                	var records = me.getSelectionModel().getSelection();
                	var auditingState=new Array();
            		auditingState.push(1);
            		auditingState.push(5);
                	win = Ext.create('PJ.view.registrationmanagement.ViewSignupStatusFrame',{
                		title: "查看审核通过人员",
                		grid: me,
                		classId:records[0].get("classId"),
                		className:records[0].get("t.className"),
//                		ministrieName:records[0].get("t.ministrieName"),查看报名
                		beginDate: records[0].get("t.beginDate"),
                		endDate: records[0].get("t.endDate"),
            			clickSource:1,
            			auditingState:auditingState,
                		openState: records[0].get("t.openState")
                	}).show();
                	var actionName = "load";//默认使用非JSONP的加载方法名“load”
                    if(gj_onlineLearning_constant.loadType=="jsonp") {
                    	actionName= "loadJsonp";
                    }
                    win.down('form').getForm().doAction(actionName,{
                    	url: me.store.configurationUrl,
                        params: {
                        	classId: records[0].get("classId")//培训班ID
                        },
                        success:function(form,action){
                        	var data = action.response.responseText;
                			var json = gj_onlineLearning_constant.loadType=="ajax" ? Ext.decode(data, true) : action.response;
                			var dateStar = json.data.beginDateStr;//举办时间（开始）
                			var dateEnd = json.data.endDateStr;//举办时间（截止）
                			var form = win.down('form');	 
                			var baseForm = form.getForm();
                			
                			baseForm.findField("className").setValue(json.data.className);//班级名称
//                			baseForm.findField("trainingDeptName").setValue(json.data.ministrieName);//委托部委
                			baseForm.findField("learnTime").setValue(dateStar + ' 至 ' + dateEnd);
                        }
                    });
                },
              	//删除
              	onDeleteClick:function(){
                	  var me = this;
                	  var store = me.getStore();
                	  var records = me.getSelectionModel().getSelection();
                	  for(var i=0;i<records.length;i++){
                		  if(records[i].get("t.publishState")==1){
                			Ext.Msg.show({
                				  title: '提示',
                			  	  msg  : '不允许删除已发布的数据！',
                			  	  icon :Ext.Msg.WARNING,
                			  	  buttons:Ext.Msg.OK
                			  });
                			  return;
                		  }
                	  };
                	Ext.Msg.confirm({
              		  title:'提示',
              		  msg:'您确定要删除这些数据吗?',
              		  icon:Ext.Msg.WARNING,
              		  buttons:Ext.Msg.OKCANCEL,
              		  fn:function(id){
              			  if(id=='ok'){
              				  var classIds= new Array();
              				  Ext.Array.each(records,function(name,index){
              					  classIds.push(name.get('classId'));
              				  });
              				  if(gj_onlineLearning_constant.loadType == "jsonp"){
              					  var store1 = Ext.create('AM.default.jsonp.DefaultAjaxStore',{
                                		loadType: gj_onlineLearning_constant.loadType,
                                        url: store.deleteUrl,
                                		  extraParams: {
                                			searchUpdateClassIds: classIds,
              							  submintType: 'activeStateToN'
                                        }
                                	});
                                	store1.load(function(rec, operation, success){
                                		if(success){
                                            Ext.Msg.alert('消息', '删除成功！', function(){
                                                var store = me.getStore();
                                                store.load();
                                            });
                                        }else{
                                            Ext.Msg.alert('消息', operation.error);
                                        }
                                	});
              				  }else{
              					  Ext.Ajax.request({
              						  url:store.deleteUrl,
              						  params: {
              							  searchUpdateClassIds: classIds,
              							  submintType: 'activeStateToN'
              	                       },
              						  success:function(response){
              							  var data=response.responseText;
              							  var json=Ext.decode(data,true);
              							  if(json.success){
              								  Orchid.alert('提示','删除成功!',function(){
              									  store.load();
              								  });
              							  }else{
              								  Orchid.alert('提示',json.msg);
              							  }
              						  }
              					  });
              				  }
              			  }
              		  }
              	  });
              	},
              	//发布
              	onIssueClick:function(){
                	  var me=this;
                	  var store=me.getStore();
                	  var records=me.getSelectionModel().getSelection();
                	  for(var i=0;i<records.length;i++){
                		  if(records[i].get("t.publishState")==1){
                			Ext.Msg.show({
                				  title: '提示',
                			  	  msg  : '已发布的班级不能再次发布!',
                			  	  icon :Ext.Msg.WARNING,
                			  	  buttons:Ext.Msg.OK
                			  });
                			  return;
                		  }
                		  if(records[i].get("t.lockState")==1){
                			Ext.Msg.show({
                				  title: '提示',
                			  	  msg  : '班级已审核不能再次进行操作!',
                			  	  icon :Ext.Msg.WARNING,
                			  	  buttons:Ext.Msg.OK
                			  });
                			  return;
                		  }
                		/*  if(records[i].get("auditState")!=1){
                			Ext.Msg.show({
              				  title: '提示',
              			  	  msg  : '只允许对审核通过的数据进行发布!',
              			  	  icon :Ext.Msg.WARNING,
              			  	  buttons:Ext.Msg.OK
              			  });
              			  return;
                		  }*/
                	  };
                	Ext.Msg.confirm({
              		  title:'提示',
              		  msg:'您确定要发布这些数据吗?',
              		  icon:Ext.Msg.WARNING,
              		  buttons:Ext.Msg.OKCANCEL,
              		  fn:function(id){
              			  if(id=='ok'){
              				  var classIds= new Array();
              				  Ext.Array.each(records,function(name,index){
              					  classIds.push(name.get('classId'));
              				  });
              				  
              				  if(gj_onlineLearning_constant.loadType == "jsonp"){
              					  var store1 = Ext.create('AM.default.jsonp.DefaultAjaxStore',{
                                		loadType: gj_onlineLearning_constant.loadType,
                                        url: store.issueUrl,
                                		  extraParams: {
                                			searchUpdateClassIds: classIds,
                                			submintType: 'publishStateToY'
                                        }
                                	});
                                	store1.load(function(rec, operation, success){
                                		if(success){
                                            Ext.Msg.alert('消息', '发布成功！', function(){
                                                var store = me.getStore();
                                                store.load();
                                            });
                                        }else{
                                            Ext.Msg.alert('消息', operation.error);
                                        }
                                	});
              				  }else{
              					  Ext.Ajax.request({
              						  url:store.issueUrl,
              						  params: {
              	                  			searchUpdateClassIds: classIds,
              	                  			submintType: 'publishStateToY'
              						  },
              						  success:function(response){
              							  var data=response.responseText;
              							  var json=Ext.decode(data,true);
              							  if(json.success){
              								  Orchid.alert('提示','发布成功!',function(){
              									  store.load();
              								  });
              							  }else{
              								  Orchid.alert('提示',json.msg);
              							  }
              						  }
              					  });
              				  }
              			  }
              		  }
              	  });
              	},
              	/**
              	 * 锁定班次
              	 */
              	onLockClass:function(){
              	  var me=this;
              	  var store=me.getStore();
              	  var records=me.getSelectionModel().getSelection();
              	  var isSponsror = false;
              	  for(var i=0;i<records.length;i++){
              		  if(records[i].get("t.lockState")==1){
              			Ext.Msg.show({
              				  title: '提示',
              			  	  msg  : '班级已审核不能再次进行操作!',
              			  	  icon :Ext.Msg.WARNING,
              			  	  buttons:Ext.Msg.OK
              			  });
              			  return;
              		  }
              		if(records[i].get("t.sponsorName") != "中共北京市委组织部" && records[i].get("t.sponsorName") != "中共中央组织部"){
              			isSponsror = true;
              		  }
              	  };
              	if(isSponsror){
              		Ext.Msg.confirm({
              		  title:'提示',
              		  msg:'本班次主办单位非“中共北京市委组织部”或“中共中央组织部”请确认是否核实完毕。',
              		  icon:Ext.Msg.WARNING,
              		  buttons:Ext.Msg.OKCANCEL,
              		  fn:function(id){
              			  if(id=='ok'){
              				  var classIds= new Array();
              				  Ext.Array.each(records,function(name,index){
              					  classIds.push(name.get('classId'));
              				  });
              				  
              				  if(gj_onlineLearning_constant.loadType == "jsonp"){
              					  var store1 = Ext.create('AM.default.jsonp.DefaultAjaxStore',{
                                		loadType: gj_onlineLearning_constant.loadType,
                                        url: store.updateClassLockState,
                                		  extraParams: {
                                			searchUpdateClassIds: classIds
                                        }
                                	});
                                	store1.load(function(rec, operation, success){
                                		if(success){
                                            Ext.Msg.alert('消息', '审核成功！', function(){
                                                var store = me.getStore();
                                                store.load();
                                            });
                                        }else{
                                            Ext.Msg.alert('消息', operation.error);
                                        }
                                	});
              				  }else{
              					  Ext.Ajax.request({
              						  url:store.updateClassLockState,
              						  params: {
              	                  			searchUpdateClassIds: classIds
              						  },
              						  success:function(response){
              							  var data=response.responseText;
              							  var json=Ext.decode(data,true);
              							  if(json.success){
              								  Orchid.alert('提示','审核成功!',function(){
              									  store.load();
              								  });
              							  }else{
              								  Orchid.alert('提示',json.msg);
              							  }
              						  }
              					  });
              				  }
              			  }
              		  }
              	  });
              	}else{
              		Ext.Msg.confirm({
              		  title:'提示',
              		  msg:'您确定要审核班级吗?',
              		  icon:Ext.Msg.WARNING,
              		  buttons:Ext.Msg.OKCANCEL,
              		  fn:function(id){
              			  if(id=='ok'){
              				  var classIds= new Array();
              				  Ext.Array.each(records,function(name,index){
              					  classIds.push(name.get('classId'));
              				  });
              				  
              				  if(gj_onlineLearning_constant.loadType == "jsonp"){
              					  var store1 = Ext.create('AM.default.jsonp.DefaultAjaxStore',{
                                		loadType: gj_onlineLearning_constant.loadType,
                                        url: store.updateClassLockState,
                                		  extraParams: {
                                			searchUpdateClassIds: classIds
                                        }
                                	});
                                	store1.load(function(rec, operation, success){
                                		if(success){
                                            Ext.Msg.alert('消息', '审核成功！', function(){
                                                var store = me.getStore();
                                                store.load();
                                            });
                                        }else{
                                            Ext.Msg.alert('消息', operation.error);
                                        }
                                	});
              				  }else{
              					  Ext.Ajax.request({
              						  url:store.updateClassLockState,
              						  params: {
              	                  			searchUpdateClassIds: classIds
              						  },
              						  success:function(response){
              							  var data=response.responseText;
              							  var json=Ext.decode(data,true);
              							  if(json.success){
              								  Orchid.alert('提示','审核成功!',function(){
              									  store.load();
              								  });
              							  }else{
              								  Orchid.alert('提示',json.msg);
              							  }
              						  }
              					  });
              				  }
              			  }
              		  }
              	  });
              	}
              	
            	},
            	/**
              	 * 导出xml
              	 */
                onExportClassUserXml:function(){
              	  var me=this;
              	  var store=me.getStore();
              	  var records=me.getSelectionModel().getSelection();
              	  for(var i=0;i<records.length;i++){
              		  if(records[i].get("t.lockState")==0){
              			Ext.Msg.show({
              				  title: '提示',
              			  	  msg  : '请先审核班级再进行导出!',
              			  	  icon :Ext.Msg.WARNING,
              			  	  buttons:Ext.Msg.OK
              			  });
              			  return;
              		  }
              	  };
              	for(var i=0;i<records.length;i++){
            		  if(records[i].get("shiguanNum")<=0){
            			Ext.Msg.show({
            				  title: '提示',
            			  	  msg  : '该班级没有市管学员!',
            			  	  icon :Ext.Msg.WARNING,
            			  	  buttons:Ext.Msg.OK
            			  });
            			  return;
            		  }
            	  };
              	Ext.Msg.confirm({
            		  title:'提示',
            		  msg:'您确定要导出xml吗?',
            		  icon:Ext.Msg.WARNING,
            		  buttons:Ext.Msg.OKCANCEL,
            		  fn:function(id){
            			  if(id=='ok'){
            				  var classIds= new Array();
            				  Ext.Array.each(records,function(name,index){
            					  classIds.push("'"+name.get('classId')+"'");
//            					  classIds.push(name.get('classId'));
            				  });
            				  href=store.exportClassUserXml + "?";
                          	  href+="searchUpdateClassIds=" + classIds;
                              href = encodeURI(href);
                              var atag = Ext.get("exportResume");
                              atag.set({
                                  "href": href
                              });
                              atag.dom.click();
            			  }
            		  }
            	  });
            	},
              	//撤销发布
              	onIssuenoClick:function(){
              		var me=this;
              		var store=me.getStore();
              		var records=me.getSelectionModel().getSelection();
              		for(var i=0;i<records.length;i++){
              			if(records[i].get("t.openState") ==3){
              				Ext.Msg.show({
              					title: '提示',
              					msg  : '不允许对已结班的数据执行撤销发布操作!',
              					icon :Ext.Msg.WARNING,
              					buttons:Ext.Msg.OK
              				});
              				return;
              			}
              			if(records[i].get("t.publishState")==2){
              				Ext.Msg.show({
              					title: '提示',
              					msg  : '不允许未发布的数据执行撤销发布操作!',
              					icon :Ext.Msg.WARNING,
              					buttons:Ext.Msg.OK
              				});
              				return;
              			}
              		};
              		Ext.Msg.confirm({
              			title:'提示',
              			msg:'您确定要撤销这些数据吗?',
              			icon:Ext.Msg.WARNING,
              			buttons:Ext.Msg.OKCANCEL,
              			fn:function(id){
              				if(id=='ok'){
              					var classIds= new Array();
              					Ext.Array.each(records,function(name,index){
              						classIds.push(name.get('classId'));
              					});
              					if(gj_onlineLearning_constant.loadType == "jsonp"){
              						var store1 = Ext.create('AM.default.jsonp.DefaultAjaxStore',{
              							loadType: gj_onlineLearning_constant.loadType,
              							url: store.noIssueUrl,
              							extraParams: {
              	                  			searchUpdateClassIds: classIds,
              	                  			submintType: 'publishStateToN'
              							}
              						});
              						store1.load(function(rec, operation, success){
              							if(success){
              								Ext.Msg.alert('消息', '撤销成功!', function(){
              									var store = me.getStore();
              									store.load();
              								});
              							}else{
              								Ext.Msg.alert('消息', operation.error);
              							}
              						});
              					}else{
              						Ext.Ajax.request({
              							url:store.noIssueUrl,
              							params: {
              	                  			searchUpdateClassIds: classIds,
              	                  			submintType: 'publishStateToN'
              							},
              							success:function(response){
              								var data=response.responseText;
              								var json=Ext.decode(data,true);
              								if(json.success){
              									Orchid.alert('提示','撤销成功!',function(){
              										store.load();
              									});
              								}else{
              									Orchid.alert('提示',json.msg);
              								}
              							}
              						});
              					}
              				}
              			}
              		});
              	},
              	//审核通过
              	onApprovalClick: function(){
              		var me=this;
              		var store=me.getStore();
              		var records=me.getSelectionModel().getSelection();
              		for(var i=0;i<records.length;i++){
              			if(records[i].get("auditState")==1){
              				Ext.Msg.show({
              					title: '提示',
              					msg  : '不允许审核通过的数据再次执行审核通过操作!',
              					icon :Ext.Msg.WARNING,
              					buttons:Ext.Msg.OK
              				});
              				return;
              			}
              			if(records[i].get("reportState")==2){
              				Ext.Msg.show({
              					title: '提示',
              					msg  : '不允许对未提交的数据执行审核通过操作!',
              					icon :Ext.Msg.WARNING,
              					buttons:Ext.Msg.OK
              				});
              				return;
              			}
              		};
              		Ext.Msg.confirm({
              			title:'提示',
              			msg:'您确定这些数据审核已通过吗?',
              			icon:Ext.Msg.WARNING,
              			buttons:Ext.Msg.OKCANCEL,
              			fn:function(id){
              				if(id=='ok'){
              					var classIds= new Array();
              					Ext.Array.each(records,function(name,index){
              						classIds.push(name.get('classId'));
              					});
              					if(gj_onlineLearning_constant.loadType == "jsonp"){
              						var store1 = Ext.create('AM.default.jsonp.DefaultAjaxStore',{
              							loadType: gj_onlineLearning_constant.loadType,
              							url: store.reuseUrl,
              							extraParams: {
              								searchUpdateClassIds: classIds,
              								submintType: 'auditClassStateToY'
              							}
              						});
              						store1.load(function(rec, operation, success){
              							if(success){
              								Ext.Msg.alert('消息', '审核成功!', function(){
              									var store = me.getStore();
              									store.load();
              								});
              							}else{
              								Ext.Msg.alert('消息', operation.error);
              							}
              						});
              					}else{
              						Ext.Ajax.request({
              							url:store.reuseUrl,
              							params: {
              								searchUpdateClassIds: classIds,
              								submintType: 'auditClassStateToY'
              							},
              							success:function(response){
              								var data=response.responseText;
              								var json=Ext.decode(data,true);
              								if(json.success){
              									Orchid.alert('提示','审核成功!',function(){
              										store.load();
              									});
              								}else{
              									Orchid.alert('提示',json.msg);
              								}
              							}
              						});
              					}
              				}
              			}
              		});
              	},
              	//审核驳回
              	onDismissedClick: function(){
              		var me=this;
              		var store=me.getStore();
              		var records=me.getSelectionModel().getSelection();
              		var classIds= new Array();
              		Ext.Array.each(records,function(name,index){
              			classIds.push(name.get('classId'));
              		});
              		for(var i=0;i<records.length;i++){
              			if(records[i].get("reportState")==2){
              				Ext.Msg.show({
              					title: '提示',
              					msg  : '不允许对未提交的数据执行审核通过操作!',
              					icon :Ext.Msg.WARNING,
              					buttons:Ext.Msg.OK
              				});
              				return;
              			}
              			if(records[i].get("auditState")==2){
              				Ext.Msg.show({
              					title: '提示',
              					msg  : '不允许对未审核通过的数据执行审核驳回操作!',
              					icon :Ext.Msg.WARNING,
              					buttons:Ext.Msg.OK
              				});
              				return;
              			}
              			if(records[i].get("t.publishState")==1){
              				Ext.Msg.show({
              					title: '提示',
              					msg  : '不允许对已发布的数据执行审核驳回操作！',
              					icon :Ext.Msg.WARNING,
              					buttons:Ext.Msg.OK
              				});
              				return;
              			}
              		};
              		Ext.create('PJ.view.trainingmanagement.CheckEdit',{
                      	title: "审核驳回原因",
                          flag:1,
                          classIds: classIds,
                      	grid: me
                      });
              	},
              	//上传参训通知
              	onImportClick: function(){
              		var me = this;
              		var records = me.getSelectionModel().getSelection();
              		if(records.length > 1){
              			Ext.Msg.show({
              				title: '提示',
              				msg: '只允许操作一条数据！',
              				icon: Ext.Msg.WARNING,
              				buttons: Ext.Msg.OK
              			});
              			return;
              		}
              		Ext.create("PJ.view.trainingmanagement.Upload", {
              			title: "上传参训通知",
              			height: 140,
              			width: 350,
              			grid: me,
              			classId: records[0].get('classId')
              		}).show();
//                  	Ext.create("PJ.view.trainingmanagement.UploadInfo", {
//              			title: "上传参训通知",
//              			height: 140,
//              			width: 350,
//              			grid: me,
//              			classId: records[0].get('classId')
//              		}).show();
                  },
                  //导出 -- 判断按钮是否可以操作
                  ifSelect: function(selectType, exportUrl, classId, urlExportId){
                  	var records = this.getSelectionModel().getSelection();
                  	if(selectType=='course'){
                  		if(records.length == 0){
                  			Ext.Msg.show({
                  				title: '提示',
                  				msg: '请选择一条数据进行操作！',
                  				icon: Ext.Msg.WARNING,
                  				buttons: Ext.Msg.OK
                  			});
                  			return;
                  		}
                  		if(records.length > 1){
                  			Ext.Msg.show({
                  				title: '提示',
                  				msg: '只允许操作一条数据！',
                  				icon: Ext.Msg.WARNING,
                  				buttons: Ext.Msg.OK
                  			});
                  			return;
                  		}
                  	}
                      var atag = Ext.get("exportResume");
                      var exportUrlStr = Ext.isEmpty(urlExportId)?exportUrl:exportUrl + '?'+ urlExportId + '=' + classId;
                  	atag.set({
                  		"href": exportUrlStr
                  	});
                      atag.dom.click();
                  
                  },
                /*//导入名额
                  onImportquotasClick: function(){
              		var me = this;
                  	Ext.create("PJ.view.quotamanagement.BatchImportEdit", {
              			title: "导入名额",
              			height: 110,
              			width: 380,
              			grid: me
              		}).show();
                  },*/
                  /**
                   * 计划名额
                   */
                  onPlanplacesClick: function(){
              		var me = this;
              		var record = this.getSelectionModel().getSelection();
                      if(this.getSelectionModel().getCount() > 1){
                          Ext.Msg.show({
                              title: '提示',
                              msg: '操作时只可选中一条记录！',
                              icon: Ext.Msg.WARNING,
                              buttons: Ext.Msg.OK
                          });
                      	return;
                      }
              		Ext.create('AM.default.DefaultWindowView', {
                          title: record[0].get("t.className"),
                          height:550,
                          width: 450,
                          grid: me,
                          classId:record[0].get("classId"),
                          items: [{
                              xtype: 'planPlacesList'
                          }],
                          listeners: {
                          	close: function(){
                          		me.getStore().load();
                          	}
                          }
                      });
              	},
              	onApplicationAuditClick:function(){
              		var me = this;
              		var record = this.getSelectionModel().getSelection();
	                if(this.getSelectionModel().getCount() > 1){
                      Ext.Msg.show({
                          title: '提示',
                          msg: '操作时只可选中一条记录！',
                          icon: Ext.Msg.WARNING,
                          buttons: Ext.Msg.OK
                      });
                  	 return;
	                }
                    var classId = record[0].get("classId");
      				var lockState = record[0].get("lockState");
      				var lockDateState = record[0].get("lockDateState");
      				 if(lockDateState==2){
                 			Ext.Msg.show({
                 				  title: '提示',
                 			  	  msg  : '本班级确认时间已过，请与管理员联系（63524157-8001）',
                 			  	  icon :Ext.Msg.WARNING,
                 			  	  buttons:Ext.Msg.OK
                 			  });
                 			  return;
                 		  }
                 		Ext.create('AM.default.DefaultWindowView', {
                             title: "培训学时确认",
                             height:510,
                             width: 1055,
                             grid: me,
                 			 clickSource:2,
                             classId: classId,
                             lockState: lockState,
                             items: [{
                                 xtype: 'applicationAuditUserListLevel1'
                             }],
                             listeners: {
                             	close: function(){
                             		me.getStore().load();
                             	}
                             }
                         });
              	},
              	/**
              	 * 导出培训班学习记录
              	 */
              	onExportClassRecordClick:function(){
              	  var me=this;
              	  var store=me.getStore();
              	  var records=me.getSelectionModel().getSelection();
              	  for(var i=0;i<records.length;i++){
              		  if(records[i].get("t.lockState")==0){
              			Ext.Msg.show({
              				  title: '提示',
              			  	  msg  : '请先审核班级再进行导出!',
              			  	  icon :Ext.Msg.WARNING,
              			  	  buttons:Ext.Msg.OK
              			  });
              			  return;
              		  }
              	  };
              	for(var i=0;i<records.length;i++){
            		  if(records[i].get("shiguanNum")<=0){
            			Ext.Msg.show({
            				  title: '提示',
            			  	  msg  : '该班级没有市管学员!',
            			  	  icon :Ext.Msg.WARNING,
            			  	  buttons:Ext.Msg.OK
            			  });
            			  return;
            		  }
            	  };
              	Ext.Msg.confirm({
            		  title:'提示',
            		  msg:'您确定要导出xml吗?',
            		  icon:Ext.Msg.WARNING,
            		  buttons:Ext.Msg.OKCANCEL,
            		  fn:function(id){
            			  if(id=='ok'){
            				  var classIds= new Array();
            				  Ext.Array.each(records,function(name,index){
            					  classIds.push("'"+name.get('classId')+"'");
//            					  classIds.push(name.get('classId'));
            				  });
            				  href=store.exportClassUserTotalXml + "?";
                          	  href+="searchUpdateClassIds=" + classIds;
                              href = encodeURI(href);
                              var atag = Ext.get("exportResume");
                              atag.set({
                                  "href": href
                              });
                              atag.dom.click();
            			  }
            		  }
            	  });
            	},
                  //预览
                  listeners: {
              		selectionchange: function(selModel, selected){
//              			this.down('#' + this.oldId + "Configuration").setDisabled(selected.length === 0);//配置课程
//              			this.down('#' + this.oldId + "Issue").setDisabled(selected.length === 0);//发布
//              			this.down('#' + this.oldId + "LockClass").setDisabled(selected.length === 0);//锁定班次
//              			this.down('#' + this.oldId + "ExportXmlDerive").setDisabled(selected.length === 0);//导出xml
//                        this.down('#' + this.oldId + "Issueno").setDisabled(selected.length === 0);//撤销发布
//                        this.down('#' + this.oldId + "Delete").setDisabled(selected.length === 0);//删除
//                          this.down('#' + this.oldId + "Dismissed ").setDisabled(selected.length === 0);//审核驳回
//                          this.down('#' + this.oldId + "Approval").setDisabled(selected.length === 0);//审核通过
//                        this.down('#' + this.oldId + "BatchImportRegistration").setDisabled(selected.length === 0);//上传参训通知
//                        this.down('#' + this.oldId + "Signup").setDisabled(selected.length === 0);//报名
                        this.down('#' + this.oldId + "ApplicationAudit").setDisabled(selected.length === 0);//报名审核
//                  		this.down('#' + this.oldId + "ViewSignup").setDisabled(selected.length === 0);//查看报名状态
                //          this.down('#' + this.oldId + "Planplaces").setDisabled(selected.length === 0);//计划名额
               //           this.down('#' + this.oldId + "AddMsg").setDisabled(selected.length === 0);//发送消息
              		},
              		viewready: function(){
              			var me = this;
              			//导出按钮集合
                      	var exportMenu = Ext.create('Ext.menu.Menu', {
                              items: [{
                                  text: '培训班',
              	        		iconCls: 'classIco',
                                  listeners: {
                                      click: function(btn){
                                      	var records = me.getSelectionModel().getSelection();
                                      	//me.ifSelect('class', me.store.exportTrainingUrl);
                                      	
                                          var classIdstr = "";
                                          for(var i = 0;i<records.length;i++){
                                          	if(i == records.length-1){
                                          		classIdstr += "searchClassIdList=" + records[i].get("classId");
                                          	}else{
                                          		classIdstr += "searchClassIdList=" + records[i].get("classId") + "&";
                                          	}
                                          }
                                          var atag = Ext.get("exportResume");
                                          var exportUrl = me.store.exportTrainingUrl;
                                          atag.set({
                                              "href": exportUrl + '?' + classIdstr
                                          });
                                          atag.dom.click();
                                  	}
                                  }
                              }, {
                                  text: '课程',
              	        		iconCls: 'courseIco',
                                  listeners: {
                                  	click: function(btn){
                                      	var record = me.getSelectionModel().getSelection();
                                      	var classId = Ext.isEmpty(record) ? "" : record[0].get("classId");
                                      	me.ifSelect('course', me.store.exportCourseUrl, classId, 'searchClassId');
                                  	}
                                  }
                              }, {
                                  text: '班级详情',
              	        		iconCls: 'classDetailsIco',
                                  listeners: {
                                  	click: function(btn){
                                      	var records = me.getSelectionModel().getSelection();
                                          var classIds = new Array();
                                          Ext.Array.each(records, function(name, index){
                                          	classIds.push(name.get("classId"));
                                          });
                                      	if(records.length == 0){
                                  			Ext.Msg.show({
                                  				title: '提示',
                                  				msg: '请选择所需数据进行操作！',
                                  				icon: Ext.Msg.WARNING,
                                  				buttons: Ext.Msg.OK
                                  			});
                                  			return;
                                  		}else if(records.length > 1){
                                  			Ext.Msg.show({
                                  				title: '提示',
                                  				msg: '班级详情只可以选取一条数据！',
                                  				icon: Ext.Msg.WARNING,
                                  				buttons: Ext.Msg.OK
                                  			});
                                  			return;
                                  		}else{
                                  			var atag = Ext.get("exportResume");
                                              var exportUrl = me.store.exportClassInfoUrl;
                                              atag.set({
                                                  "href": exportUrl + '?searchClassIds=' + classIds
                                              });
                                              atag.dom.click();
                                  		}
                                  	}
                                  }
                              }/*, {
                                  text: '名额对比表',
              	        		iconCls: 'comparisonsIco',
                                  listeners: {
                                  	click: function(btn){
                                  		var records = me.getSelectionModel().getSelection();
                                      	//var classId = Ext.isEmpty(record) ? "" : record[0].get("classId");
                                      	//me.ifSelect('comparisons', me.store.contrastPlacesUrl, classId, 'searchClassId');
                                      	var classIdstr = "";
                                          for(var i = 0;i<records.length;i++){
                                          	if(i == records.length-1){
                                          		classIdstr += "searchClassIds=" + records[i].get("classId");
                                          	}else{
                                          		classIdstr += "searchClassIds=" + records[i].get("classId") + "&";
                                          	}
                                          }
                                          var atag = Ext.get("exportResume");
                                          var exportUrl = me.store.contrastPlacesUrl;
                                          atag.set({
                                              "href": exportUrl + '?' + classIdstr
                                          });
                                          atag.dom.click();
                                  	}
                                  }
                              }*/]
                          });
              			this.addDocked([{
              				dock: 'top',
              				xtype: "searchform",
              				columnCount: 3,
              				fieldDefaults: {
              					labelAlign: 'right',
              					labelWidth: 100
              				},
              				items: [/*{
              					xtype: "textfield",
              					fieldLabel: '培训班编号',
              					name: "searchTrainingNum",
              					maxLength: "50",
              					emptyText: "请输入培训班编号"
              				},*/{
              					xtype: "textfield",
              					fieldLabel: '培训班名称',
              					name: "searchClassName",
              					maxLength: "50",
                                emptyText: '请输入培训班名称，若多个班级请以“，”隔开'
              				},{
              					xtype: "textfield",
              					fieldLabel: '主办单位',
              					name: "searchSponsorName",
              					maxLength: "50",
              					emptyText: "请输入主办单位，若多个单位请以“，”隔开"
              				},{
              					xtype: "combo",
              					fieldLabel: '培训班类型',
              					name: "searchClassTypeCode",
              					store: Ext.create("Ext.data.ArrayStore", {
              						fields: ['value', 'text'],
              						data: [['ztb','专题班'],['zhutb','主体班'],['zhongydx','中组部调训'],['jwpx','境外培训'],['qit', '其他']]
              					}),
              					valueField: 'value',
              					displayField: 'text',
              					editable: false,
              					emptyText: "请选择"
              				},{
                  				xtype: 'defaultDate',
                  				fieldLabel: '开班时间',
                  				name: 'searchBeginDate',
                  				id: 'searchTrainingManagementSD1',
                  				vtype: 'startLessEndDate',
                  				startLessEndDate: {
                  					targetCmpId: 'searchTrainingManagementED1',
                  					isStart: true
                  				},
                  				emptyText: "请输入开班时间"
                  			}, {
                  				xtype: 'defaultDate',
                  				fieldLabel: '结业时间:',
                  				labelSeparator: '',
                  				name: 'searchEndDate',
                  				id: 'searchTrainingManagementED1',
                  				vtype: 'startLessEndDate',
                  				vtypeText: '结束时间不能早于开始时间！',
                  				startLessEndDate: {
                  					targetCmpId: 'searchTrainingManagementSD1',
                  					isStart: false
                  				},
                  				emptyText: "请输入结业时间"
                  			},{
              					xtype: "combo",
              					fieldLabel: '锁定状态',
              					name: "searchLockState",
              					store: Ext.create("Ext.data.ArrayStore", {
              						fields: ['value', 'text'],
              						data: [[1, '已锁定'],[0,'未锁定']]
              					}),
              					valueField: 'value',
              					displayField: 'text',
              					editable: false,
              					emptyText: "请选择"
              				}/*,{
              					xtype: "combo",
              					fieldLabel: '开班年份',
              					name: "searchYear",
              					store: Ext.create("Ext.data.ArrayStore", {
              						fields: ['value', 'text'],
              						data: [[2017, '2017年'],[2016,'2016年'],[2015,'2015年'],[2014,'2014年'],[2013,'2013年'],[2012,'2012年']]
              					}),
              					valueField: 'value',
              					displayField: 'text',
              					editable: false,
              					emptyText: "请选择"
              				}*/,{
              					xtype: "numberfield",
              					fieldLabel: '班级学时',
              					name: "searchTrainingHourMin",
              					minValue:1,
              					maxValue: 9999,
              					maxLength: "5",
              					emptyText: "请输入班级学时"
              				},{
              					xtype: "numberfield",
              					fieldLabel: '至',
              					name: "searchTrainingHourMax",
              					minValue:1,
              					maxValue: 9999,
              					maxLength: "5",
              					emptyText: "请输入班级学时"
              				}],
              				grid: this
              			},{
              				xtype: 'toolbar',
              				dock: 'top',
              				displayInfo: true,
              				items: [/*this.addButton, "-", this.updateButton, "-", */
              				{
                                text: '查看详情',
                                iconCls: 'applicationAuditIco',
                                itemId: this.oldId + "ApplicationAudit",
                                disabled: true,
                                scope: this,
                                handler: this.onApplicationAuditClick
                            },/*"-",{
	                        	  text: '导出',
	                              iconCls: 'deriveIco',
	                              itemId: this.oldId + "Export",
	                              disabled: false,
	                              scope: this,
	                              handler: this.onExportClassRecordClick
	                        }, '-', {
                                text: '查看审核通过人员',
                                iconCls: 'applicationAuditIco',
                                itemId: this.oldId + "ViewSignup",
                                disabled: true,
                                scope: this,
                                handler: this.onViewSignupStatus
                            },'-',{
              					text: '删除',
              					iconCls: 'deleteIco',
              					itemId: this.oldId + "Delete",
              					disabled: true,
              					scope: this,
              					handler: this.onDeleteClick
              				}, "-",{
              					text: '审核',
              					iconCls: 'combOutIco',
              					itemId: this.oldId + "LockClass",
              					disabled: true,
              					scope: this,
              					handler: this.onLockClass
              				},*//*"-", {
              					text: '导出',
              					iconCls: 'deriveIco',
              					itemId: this.oldId + "ExportXmlDerive",
              					disabled: true,
              					scope: this,
              					handler: this.onExportClassUserXml
              				}, "-", {
              					text: '撤销发布',
              					iconCls: 'publishCancelIco',
              					itemId: this.oldId + "Issueno",
              					disabled: true,
              					scope: this,
              					handler: this.onIssuenoClick
              				},"-",{
              					text: '导入名额',
              					iconCls: 'batchImportRegistrationIco',
              					itemId: this.oldId + "Importquotas",
              					disabled: false,
              					scope: this,
              					handler: this.onImportquotasClick
              				},"-", {
              					text: '查看计划名额',
              					iconCls: 'planplacesIco',
              					itemId: this.oldId + "Planplaces",
              					disabled: true,
              					scope: this,
              					handler: this.onPlanplacesClick
              				},"-",{
              					text: '发送消息',
              					iconCls: 'addIco',
              					itemId: this.oldId + "AddMsg",
              					disabled: true,
              					scope: this,
              					handler: this.onAddMsgClick
              				},"-",{
                                  text: '配置课程',
                                  iconCls: 'configIco',
                                  itemId: this.oldId + "Configuration",
                                  disabled: true,
                                  scope: this,
                                  handler: this.onConfigurationClick
                              },"-", {
              					text: '审核通过',
              					iconCls: 'examinationPassedIco',
              					itemId: this.oldId + "Approval",
              					disabled: true,
              					scope: this,
              					handler: this.onApprovalClick
              				},"-",{
              					text: '审核驳回',
              					iconCls:'auditDismissedIco',
              					itemId: this.oldId + "Dismissed",
              					disabled: true,
              					scope: this,
              					handler:this.onDismissedClick
              				},*/
              				/*{
                               text: '上传参训通知',
                               iconCls: 'batchImportRegistrationIco',
                               itemId: this.oldId + "BatchImportRegistration",
                               disabled: true,
                               scope: this,
                               handler: this.onImportClick
           				},"-",{
                                  text: '配置课程',
                                  iconCls: 'configIco',
                                  itemId: this.oldId + "Configuration",
                                  disabled: true,
                                  scope: this,
                                  handler: this.onConfigurationClick
                              },"-",{
                                  text: '导出',
                              	xtype: 'button',
                                  cls: 'floater',
                                  textAlign: 'right',
                                  arrowAlign: 'right',
                                  itemId: this.oldId + 'Export',
                                  enableToggle: true,
                                  iconAlign: 'left',
                                  iconCls: 'deriveIco',
                                  pressedCls: 'x-btn-focus',
                                  menuActiveCls: 'x-btn-menu-active',
                                  menu: exportMenu
              				},*/"->", this.countSelectPanel]
              			}]);
                          // 触发权限过滤事件
                          me.fireEvent("permission", this);
              		}
                  }
              });
